TGML Rectangle

The <Rectangle> element defines a rectangle. You can create rounded rectangles by setting values for the attributes RadiusX and RadiusY.

Attribute Type Description

Fill

Brush

Specifies how the interior of the shape is painted.
Default: "None"
Inheritable: Yes
Animatable: Yes

Height

Double

The height of the rectangle.
Inheritable: No
Animatable: Yes

Left

Double

The x coordinate of the upper left corner of the rectangle.
Default: "0"
Inheritable: No
Animatable: Yes

Opacity

Double

A value between "0.0" (transparent) and "1.0" (opaque)
Default: "1.0"
Inheritable: No
Animatable: Yes

RadiusX

Double

For rounded rectangles. The x axis radius of the ellipse used to round off the corners of the rectangle.
Default: "0"
Inheritable: No
Animatable: Yes

RadiusY

Double

For rounded rectangles. The y axis radius of the ellipse used to round off the corners of the rectangle.
Default: "0"
Inheritable: No
Animatable: Yes

Stroke

Brush

Describes how the line is painted.
Default: "#000000"
Inheritable: Yes
Animatable: Yes

StrokeDashArray

Array of Double

The pattern of dashes and gaps used to outline shapes:
"<dash> [ <gap> <dash> <gap>...]"
If the array only specifies the first dash, the line is patterned as if a gap with the same length as the dash was specified.
An array with only one dash set to "0" will result in a line without any pattern.
Default: "0"
Inheritable: Yes
Animatable: Yes

StrokeWidth

Double

The width of the outline of a line.
Default: "1"
Inheritable: Yes
Animatable: Yes

Top

Double

The y coordinate of the upper left corner of the rectangle.
Default: "0"
Inheritable: No
Animatable: Yes

Visibility Visibility

Specifies if the element is visible or not.
Default: "Visible"
Inheritable: No
Animatable: Yes

Width

Double

The width of the rectangle.
Inheritable: No
Animatable: Yes

Example:

Copy
<TGML>
    <Rectangle Left="10" Top="10" Width="100" Height="50" Fill="#FFFF00" Stroke="#000000"/>
    <Rectangle Left="120" Top="10" Width="100" Height="50" Fill="#FFFF00" Stroke="#000000" RadiusX="10" RadiusY="10"/>
</TGML>

Example on screen: